﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.OracleClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Windows.Forms;
using BLL;
using Util;
using Model;


namespace happyMusic
{
    public partial class test5 : System.Web.UI.Page
    {
        UserService userService = new UserService();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            /**
            * 3.DataTable方式查询                 
            */
            User user = new User();
            user.UserNo = TextBox1.Text.ToString().Trim();
            DataSet ds = userService.GetUserSetByUserNo(user);
            //取值方式一： (一行一列)
            //string str = ds.Tables[0].Rows[0]["USER_NAME_CH"].ToString(); 
            //MessageBox.Show(str);
            //取值方式二：(多行一列)
            /*更多使用方式参考：https://www.cnblogs.com/microtiger/p/7838756.html*/
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)

            {
                string str = ds.Tables[0].Rows[i]["USER_NAME_CH"].ToString();

                MessageBox.Show(str);

            }
        }
    }
}